package com.atguigu.tingshu.album.api;

import com.atguigu.tingshu.album.service.AlbumAttributeValueService;
import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.album.AlbumAttributeValue;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "专辑属性管理")
@RestController
@RequestMapping("/api/album/albumInfo")
public class AlbumAttributeValueApiController {

    @Autowired
    private AlbumAttributeValueService albumAttributeValueService;

    @Operation(summary = "根据专辑id查询专辑属性值")
    @GetMapping("/findAlbumAttributeValue/{albumId}")
    public Result<List<AlbumAttributeValue>> findAlbumAttributeValueByAlbumId(@PathVariable(value = "albumId") Long albumId) {
        List<AlbumAttributeValue> albumAttributeValueList = albumAttributeValueService.findAlbumAttributeValueByAlbumId(albumId);
        return Result.ok(albumAttributeValueList);
    }
}
